
import { getLocalUserStatus } from "@/utils";
import { Navigate } from "react-router-dom";

export default function RouterGruad({role, children }){
    const userStatus = getLocalUserStatus();
    if( userStatus && userStatus.user_role === role && userStatus.token) {
        return <>{children}</>;
    } 
    
    return <Navigate to='/login' replace />;
    
}

